package com.foreknow.demo2;

import java.util.Scanner;

public class LoopWork {
    public static void main(String[] args) {
        String isSet = "";
        do {
            System.out.println("请您选择需要设置价格的商品");
            Scanner inputSerial = new Scanner(System.in);
            int serialNum = inputSerial.nextInt();
            String serialName = "";
            switch (serialNum){
                case 1:
                    serialName = "fender";
                    break;
                case 2:
                    serialName = "gibson";
                    break;
                case 3:
                    serialName = "yamaha";
                    break;
            }
            System.out.println("您选择了商品：" + serialName + "请为该商品设置价格");
            Scanner inputPrice = new Scanner(System.in);
            int serialPrice = inputPrice.nextInt();
            System.out.println(serialName + "的价格为" + serialPrice);
            System.out.println("请问您是否想为其它商品设置价格(y/n)");
            Scanner inputIs = new Scanner(System.in);
            isSet = inputIs.next();

        }while (isSet == "y");


    }
}
